package com.java1412.dao;

import com.java1412.entity.Users;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

/**
 * @author java1412
 * @create 2021-05-20 11:28
 */
@Repository
public interface UsersMapper {
    @Select(value = "select * from tb_users where id=#{id}")
    public Users findUserById(@Param(value = "id") Integer id);

    @Insert(value = "insert into tb_users(username,birthday,sex,address) values(#{username},#{birthday},#{sex},#{address})")
    public Integer insertUsers(Users users);

    @Update(value = "update tb_users set username=#{username},birthday=#{birthday},sex=#{sex},address=#{address} where id=#{id}")
    public Integer updateUser(Users users);

    @Delete(value = "delete from tb_users where id=#{id}")
    public Integer deleteById(@Param("id") Integer id);
}
